import { host, prefix } from "./const/index";
import request from '@/common/dpapi/const/request'


// 登录-微信跳转注册登录
export const loginWechat = `${host}${prefix}/weChat/register`


// 刷新token
export const refreshTokenUrl = `${host}${prefix}/iam/token`

/**
 * 微信授权后台接口地址
 */
export const authUrl = ''// process.env.TARO_ENV === 'h5' ? `${location.origin}${prefix}/weChat/authorize?deepexiTenantId=${deepexiTenantId}&deepexiAppId=${deepexiAppId}` : ''
/**
 * 微信小程序授权后台接口地址
 */
export const authWeappUrl = data => {
    return `${host}${prefix}/weChat/applet/authorize?deepexiTenantId=${data.tenantId}&deepexiAppId=${data.appId}`
}

/**
 * 微信小程序解析unionId
 */
// export const getUnionId = `${host}${prefix}/weChat/applet/appletDecryptData?deepexiTenantId=${deepexiTenantId}&deepexiAppId=${deepexiAppId}`

/**
 * 微信小程序手机号注册接口地址
 */
// export const WeappBindPhone = process.env.TARO_ENV === 'weapp' ? `${host}${prefix}/weChat/applet/binding/mobilePhone?deepexiTenantId=${deepexiTenantId}&deepexiAppId=${deepexiAppId}` : ''

/**
 * 获取用户信息
 */
export const getUserInfo = data => request(`${host}${prefix}/members/detail`, data)


/**
 * 根据租户Id获取第三方平台的appId
 */
export const getWxConfig = `${host}${prefix}/sys/sysDataDictionary/getWxConfig`

/** 注册登录改造新接口 */
// 注册接口
export const registerUser = `${host}${prefix}/phone/register`

// 密码登录
export const loginByPassword = `${host}${prefix}/phone/authPhoneAccountLogin`


// 设置密码
export const setPassword = `${host}${prefix}/phone/setPwd`

